<?php

use Illuminate\Support\Facades\Route;
use App\Http\Controllers\StaticPagesController; // 添加这行
use App\Http\Controllers\UsersController;
use App\Http\Controllers\SessionsController;
use App\Http\Controllers\StatusesController;
use App\Http\Controllers\FollowersController;

Route::get('/', [StaticPagesController::class, 'home'])->name('home');
Route::get('/help', [StaticPagesController::class, 'help'])->name('help');
Route::get('/about', [StaticPagesController::class, 'about'])->name('about');
Route::get('signup', [UsersController::class, 'create'])->name('signup');
Route::get('/users/{user}', [UsersController::class, 'show'])->name('users.show');
Route::resource('users', UsersController::class);
Route::get('login', [SessionsController::class, 'create'])->name('login');
Route::post('login', [SessionsController::class, 'store']);
Route::delete('logout', [SessionsController::class, 'destroy'])->name('logout');
Route::get('/users/{user}/edit', [UsersController::class,'edit'])->name('users.edit');
Route::resource('statuses', StatusesController::class, ['only' => ['store', 'destroy']]);
Route::get('/users/{user}/followings', [UsersController::class, 'followings'])->name('users.followings');
Route::get('/users/{user}/followers', [UsersController::class, 'followers'])->name('users.followers');
Route::post('/users/followers/{user}', [FollowersController::class, 'store'])->name('followers.store');
Route::delete('/users/followers/{user}', [FollowersController::class, 'destroy'])->name('followers.destroy');
